package com.zxy.main;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class WebSocketUtils
{
	public static final Map<String, WebSocketsStatic> serverClients = new ConcurrentHashMap<String, WebSocketsStatic>();

	public static boolean sendMessage(String inputMsg)
	{
		boolean bResult = false;
		for(WebSocketsStatic server: serverClients.values())
		{
			if(server.getSession() != null && server.getSession().isOpen())
			{
				server.getSession().getAsyncRemote().sendText(inputMsg);
				bResult = true;
			}
		}
		return bResult;
	}
}
